import React from 'react'
import axios from 'axios'

class AjaxTest extends React.Component {
    constructor(props) {
        super(props)
        this.state = {}
    }
    render() {
        return (
            <h2>AjaxTest</h2>
        )
    }
    componentDidMount() {
        const promise = axios.get('https://kyfw.12306.cn/otn/leftTicket/query?leftTicketDTO.train_date=2020-03-16&leftTicketDTO.from_station=BJP&leftTicketDTO.to_station=GZQ&purpose_codes=ADULT')
        promise.then((res)=>{
            console.log(res)
        })
    }
}
export default AjaxTest;
